# 轮盘抽奖
# 0.01，0.02，0.03，……，0.08  一等
# 0.08-0.3  二等
# 0.31-1   三等
import random


# 取0-1之间的一个数
def drawNum():
    n = random.random()
    if 0 < n <= 0.08:
        return 1
    elif 0.08 < n <= 0.3:
        return 2
    elif 0.3 < n <= 1:
        return 3


d = {1: 0, 2: 0, 3: 0}
for i in range(10000):
    r = drawNum()
    d[r] += 1
for j, v in d.items():
    print("%d等级需要奖品数为:%d" % (j, v))
